import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { lotmonthlycardVO, lotmonthlycardForm, lotmonthlycardQuery } from '@/api/access/parking-lot/parking-lot-monthly-card/types';

/**
 * 查询停车场-月卡列表
 * @param query
 * @returns {*}
 */

export const listlotmonthlycard = (query?: lotmonthlycardQuery): AxiosPromise<lotmonthlycardVO[]> => {
  return request({
    url: '/parkinglot/lotMonthlyCard/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询停车场-月卡详细
 * @param parkingLotMonthlyCardId
 */
export const getlotmonthlycard = (parkingLotMonthlyCardId: string | number): AxiosPromise<lotmonthlycardVO> => {
  return request({
    url: '/parkinglot/lotMonthlyCard/' + parkingLotMonthlyCardId,
    method: 'get'
  });
};

/**
 * 新增停车场-月卡
 * @param data
 */
export const addlotmonthlycard = (data: lotmonthlycardForm) => {
  return request({
    url: '/parkinglot/lotMonthlyCard',
    method: 'post',
    data: data
  });
};

/**
 * 修改停车场-月卡
 * @param data
 */
export const updatelotmonthlycard = (data: lotmonthlycardForm) => {
  return request({
    url: '/parkinglot/lotMonthlyCard',
    method: 'put',
    data: data
  });
};

/**
 * 删除停车场-月卡
 * @param parkingLotMonthlyCardId
 */
export const dellotmonthlycard = (parkingLotMonthlyCardId: string | number | Array<string | number>) => {
  return request({
    url: '/parkinglot/lotMonthlyCard/' + parkingLotMonthlyCardId,
    method: 'delete'
  });
};
